package com.xys.auth.controller;

import com.xys.auth.bean.Syslog;
import com.xys.auth.service.ISyslogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@RequestMapping("/sysLog")
@Controller
public class SyslogController {

    @Autowired
    private ISyslogService sysLogService;

    @RequestMapping("/findAll.do")
    public ModelAndView findAll() throws Exception {
        ModelAndView mv = new ModelAndView();
        List<Syslog> syslogs = sysLogService.findAll();
        mv.addObject("syslogs", syslogs);
        mv.setViewName("syslog-list");
        return mv;
    }

}
